﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="NewsList.ascx.cs" Inherits="Admin_News_NewsList" %>
<%@ Register Src="~/Admin/Control/Pager/Pager.ascx" TagName="Pager" TagPrefix="uc1" %>
<%@ Register Assembly="GroupDropDownList" Namespace="GroupDropDownList" TagPrefix="cc1" %>
<%@ Import Namespace="WB.Library" %>
<h2>
    Danh sách tin tức
</h2>
<div style="margin-bottom: 15px">
    <table width="100%">
        <%--<tr>
            <td width="90px">
                Ngôn ngữ
            </td>
            <td>
                <asp:DropDownList ID="ddlLang" runat="server" Width="450px" 
                    AppendDataBoundItems="true" AutoPostBack="True" 
                    ontextchanged="ddlLang_TextChanged">
                    <asp:ListItem Selected="True" Value="">Tất cả</asp:ListItem>
                    <asp:ListItem  Value="vi-VN">Tiếng Việt</asp:ListItem>
                    <asp:ListItem Value="en-US">Tiếng Anh</asp:ListItem>
                </asp:DropDownList>
            </td>
        </tr>--%>
        <tr>
            <td width="90px">
                Danh mục
            </td>
            <td>
                <cc1:GroupDropDownList ID="ddlCategory" runat="server" Width="450px" AppendDataBoundItems="true">
                    <%--<asp:ListItem Selected="True" Value="">Tất cả</asp:ListItem>--%>
                </cc1:GroupDropDownList>
            </td>
        </tr>
        <tr>
            <td width="90px">
                Tên tin tức
            </td>
            <td>
                <asp:TextBox ID="txtTitle" runat="server" Width="450px"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td>
               
            </td>
            <td>
                 <asp:Button ID="btnSearch" runat="server" Text="Tìm" OnClick="btnSearch_Click" />
                <asp:Button ID="btnAddNews" runat="server" Text="Thêm mới" 
                     onclick="btnAddNews_Click"/>
            </td>
        </tr>
    </table>
</div>
<table class="table">
    <tr>
        <th width="50px">
            STT
        </th>
        <th>
            Tin tức
        </th>
       <%-- <th>
            Tin tức tiếng Anh
        </th>--%>
        <th>
            Danh mục cha
        </th>
        <th width="120px">
            Người đăng
        </th>
        <th width="40px">
        </th>
    </tr>
    <asp:Repeater ID="rep" runat="server" onitemcommand="rep_ItemCommand">
        <ItemTemplate>
            <tr>
                <td align="center">
                    <%# Container.ItemIndex + 1 %>
                </td>
                <td><a href='<%#GetEditUrl( Eval("Id")) %>'>
                    <%# Eval("title_vn") %>
                    </a>
                </td>
                <%--<td><a href='<%#GetEditUrl( Eval("Id")) %>'>
                    <%# Eval("title_en") %>
                    </a>
                </td>--%>
                <td>
                    <%# Eval("CatName")%>
                </td>
                <td>
                    <%# Eval("CreatedBy") %>
                </td>
                <td align="center">
                    <asp:LinkButton ID="del" runat="server" CommandName="del" CommandArgument='<%# Eval("Id") %>' OnClientClick="return confirm('Bạn xác nhận xóa dữ liệu?')"><img src="../images/delete.png" /></asp:LinkButton>
                </td>
            </tr>
        </ItemTemplate>
    </asp:Repeater>
</table>
<uc1:Pager ID="Pager1" runat="server"/>
